package org.spiderflow;

import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletException;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.util.WebAppRootListener;

import java.io.IOException;

@SpringBootApplication
@EnableScheduling
@MapperScan(basePackages = "org.spiderflow.core.mapper")
public class SpiderApplication implements ServletContextInitializer {
	
	public static void main(String[] args) throws IOException {
		
		SpringApplication.run(SpiderApplication.class, args);

		System.out.println("服务启动成功...");
	}

	@Override
	public void onStartup(ServletContext servletContext) throws ServletException {
		servletContext.addListener(WebAppRootListener.class);
		servletContext.setInitParameter("org.apache.tomcat.websocket.textBufferSize","1024000");
	}
}
